import axios from 'axios'
const service=axios.create({
    baseURL:"http://7dqwr7.natappfree.cc",
    timeout:5000
})
service.interceptors.request.use(
    config=>{
        // console.log("config",config)
        return config
    },
    error=>{
        return Promise.reject(error)
    }
)

service.interceptors.response.use(
    response=>{
        // console.log("response",response)
        if(response.data.code===200){
            return response.data.data
        }else{
            return Promise.reject(response.data)
        }
    },
    error=>{
        return Promise.reject(error)
    }
)

export default service
